package com.example.accessdemo.dao;

import com.example.accessdemo.service.AsyncService;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.logging.Logger;

@Repository
public class UploadDAO {

    public void save(List<UploadData> list, AsyncService asyncService) {
        int count = 0;
        for (UploadData data: list){
            count += 1;
            asyncService.updateProgress("已保存" + count + "条数据！");
            System.out.println("已保存" + count + "条数据！");
        }
        // 如果是mybatis,尽量别直接调用多次insert,自己写一个mapper里面新增一个方法batchInsert,所有数据一次性插入
    }
}
